const cloud = require('wx-server-sdk')
cloud.init()
const db = cloud.database()
exports.main = async (event, context) => {
  let now_time = new Date().getTime()
  console.log(now_time)
  try {
    return await db.collection('score_rank').where({
      update_time: db.command.lte(now_time)
    }).remove()
  } catch (e) {
    console.log(e)
  }
}